#ifndef __BSP_KEY_H
#define __BSP_KEY_H

#include <stdint.h>
#include <stdio.h>

#include "main.h"
#include "cmsis_os.h"

#include "queue.h"
#include "stm32f4xx_hal.h"        
#include "stm32f4xx_hal_gpio.h"
#include "Com_Debug.h"

typedef enum
{
  KEY_OK                = 0,           /* Operation completed successfully.  */
  KEY_ERROR             = 1,           /* Run-time error without case matched*/
  KEY_ERRORTIMEOUT      = 2,           /* Operation failed with timeout      */
  KEY_ERRORRESOURCE     = 3,           /* Resource not available.            */
  KEY_ERRORPARAMETER    = 4,           /* Parameter error.                   */
  KEY_ERRORNOMEMORY     = 5,           /* Out of memory.                     */
  KEY_ERRORISR          = 6,           /* Not allowed in ISR context         */
  KEY_RESERVED          = 0x7FFFFFFF   /* Reserved                           */
} key_status_t;



typedef enum
{
  KEY_PRESSED           = 0,           /* Operation completed successfully.  */
  KEY_NOT_PRESSED       = 1,           /* Run-time error without case matched*/
} key_press_status_t;

key_status_t key_scan (key_press_status_t* key_value);

void key_task_func(void *argument);

#endif //End of _BSP_KEY_H_